<template>
  <div class="base-info">
    <department class="department" />
    <div style="width: calc(100% - 240px);">
      <el-tabs
          v-model="activeName"
          type="border-card"
          @tab-click="handleClick"
          style="height:500px"
      >
        <!-- <el-tab-pane label="任免审批表打印页" name="printing">
           <div class="pane-item">
             <AppointmentApprovalTable></AppointmentApprovalTable>
           </div>
         </el-tab-pane> -->
        <el-tab-pane label="基础信息管理" name="base">
          <div class="pane-item">
            <PersonnelBaseTable ref="base"></PersonnelBaseTable>
          </div>
        </el-tab-pane>
        <!-- <el-tab-pane label="人员基础信息" name="info">
          <div class="pane-item">
            <personnel-information-table></personnel-information-table>
          </div>
        </el-tab-pane> -->

      </el-tabs>
      <el-tabs
          v-model="activeSunName"
          type="border-card"
          @tab-click="handleClick"
          class="tab-main"
          style="height:33%;margin-top: 24px;"
      >
        <!-- <el-tab-pane label="任免审批表打印页" name="printing">
           <div class="pane-item">
             <AppointmentApprovalTable></AppointmentApprovalTable>
           </div>
         </el-tab-pane> -->
        <!-- <el-tab-pane label="人员基础信息" name="info">
          <div class="pane-item">
            <personnel-information-table></personnel-information-table>
          </div>
        </el-tab-pane> -->
        <el-tab-pane label="人员基础信息子集" name="baseStaffSubset">
          <div class="pane-item-1">
            <PersonnelBaseStaffSubsetTable ref="baseStaffSubset"></PersonnelBaseStaffSubsetTable>
          </div>
        </el-tab-pane>
        <el-tab-pane label="学历及学位子集" name="degree">
          <div class="pane-item-1">
            <PersonnelDegreeTable ref="degree"></PersonnelDegreeTable>
          </div>
        </el-tab-pane>
        <el-tab-pane label="行政党派职务子集" name="administrative">
          <div class="pane-item-1">
            <AdministrativePositionTable ref="administrative"></AdministrativePositionTable>
          </div>
        </el-tab-pane>
        <el-tab-pane label="政治面貌及党籍情况子集" name="political">
          <div class="pane-item-1">
            <PoliticalOutlookTable ref="political"></PoliticalOutlookTable>
          </div>
        </el-tab-pane>
        <el-tab-pane label="专业技术职务子集" name="technical">
          <div class="pane-item-1">
            <TechnicalPositionTable ref="technical"></TechnicalPositionTable>
          </div>
        </el-tab-pane>
        <el-tab-pane label="工人技术等级子集" name="workerLevel">
          <div class="pane-item-1">
            <TechnicalLevelTable ref="workerLevel"></TechnicalLevelTable>
          </div>
        </el-tab-pane>
        <el-tab-pane label="工资子集" name="wage">
          <div class="pane-item-1">
            <WageSubsetTable ref="wage"></WageSubsetTable>
          </div>
        </el-tab-pane>
        <el-tab-pane label="工资变动子集" name="WageChange">
          <div class="pane-item-1">
            <WageChangeTable ref="WageChange"></WageChangeTable>
          </div>
        </el-tab-pane>
        <el-tab-pane label="岗位信息子集" name="position">
          <div class="pane-item-1">
            <PositionInformationTable ref="position"></PositionInformationTable>
          </div>
        </el-tab-pane>
        <el-tab-pane label="特殊人才子集" name="SpecialTalents">
          <div class="pane-item-1">
            <SpecialTalentsTable ref="SpecialTalents"></SpecialTalentsTable>
          </div>
        </el-tab-pane>
        <el-tab-pane label="个人简历子集" name="resume">
          <div class="pane-item-1">
            <CurriculumVitaeTable ref="resume"></CurriculumVitaeTable>
          </div>
        </el-tab-pane>
        <el-tab-pane label="执(职)业资格子集" name="occupation">
          <div class="pane-item-1">
            <ProfessionalQualificationTable ref="occupation"></ProfessionalQualificationTable>
          </div>
        </el-tab-pane>
        <el-tab-pane label="教育培训子集" name="education">
          <div class="pane-item-1">
            <EducationTrainingTable ref="education"></EducationTrainingTable>
          </div>
        </el-tab-pane>
        <el-tab-pane label="奖励(行政及党内)子集" name="reward">
          <div class="pane-item-1">
            <RewardSubsetTable ref="reward"></RewardSubsetTable>
          </div>
        </el-tab-pane>
        <el-tab-pane label="惩罚(行政及党内)子集" name="penalty">
          <div class="pane-item-1">
            <PenaltySubsetTable ref="penalty"></PenaltySubsetTable>
          </div>
        </el-tab-pane>
        <el-tab-pane label="家庭成员及社会关系子集" name="FamilySociety">
          <div class="pane-item-1">
            <FamilySocietyTable ref="FamilySociety"></FamilySocietyTable>
          </div>
        </el-tab-pane>
        <el-tab-pane label="流动情况子集" name="Liquidity">
          <div class="pane-item-1">
            <LiquiditySubsetTable ref="Liquidity"></LiquiditySubsetTable>
          </div>
        </el-tab-pane>
        <el-tab-pane label="劳动合同签订情况子集" name="labor">
          <div class="pane-item-1">
            <LaborContractTable ref="labor"></LaborContractTable>
          </div>
        </el-tab-pane>
        <el-tab-pane label="干部调整与交流子集" name="cadre">
          <div class="pane-item-1">
            <AdjustCommunicationTable ref="cadre"></AdjustCommunicationTable>
          </div>
        </el-tab-pane>
        <el-tab-pane label="离休退休子集" name="retirement">
          <div class="pane-item-1">
            <RetirementSubsetTable ref="retirement"></RetirementSubsetTable>
          </div>
        </el-tab-pane>
        <el-tab-pane label="组织考察(考核)子集" name="investigation">
          <div class="pane-item-1">
            <OrganizationInvestigationTable ref="investigation"></OrganizationInvestigationTable>
          </div>
        </el-tab-pane>
        <el-tab-pane label="兼任职务子集" name="concurrent">
          <div class="pane-item-1">
            <ConcurrentPositionTable ref="concurrent"></ConcurrentPositionTable>
          </div>
        </el-tab-pane>
        <el-tab-pane label="出国(出境)子集" name="GoingAbroad">
          <div class="pane-item-1">
            <GoingAbroadTable ref="GoingAbroad"></GoingAbroadTable>
          </div>
        </el-tab-pane>
      </el-tabs>
    </div>
  </div>
</template>

<script>
import PersonnelBaseTable from './modules/PersonnelBaseTable'
import PersonnelDegreeTable from '../PersonnelDegree/modules/PersonnelDegreeTable'
import PersonnelBaseStaffSubsetTable from '../PersonnelBaseStaffSubset/PersonnelBaseStaffSubsetTable'
import AdministrativePositionTable from '../AdministrativePosition/modules/AdministrativePositionTable'
import PoliticalOutlookTable from '../PoliticalOutlook/modules/PoliticalOutlookTable'
import TechnicalPositionTable from '../TechnicalPosition/modules/TechnicalPositionTable'
import TechnicalLevelTable from '../TechnicalLevel/modules/TechnicalLevelTable'
import WageSubsetTable from '../WageSubset/WageSubsetTable'
import WageChangeTable from '../WageChange/WageChangeTable'
import PositionInformationTable from '../PositionInformation/PositionInformationTable'
import SpecialTalentsTable from '../SpecialTalents/SpecialTalentsTable'
import ProfessionalQualificationTable from '../ProfessionalQualification/ProfessionalQualificationTable'
import EducationTrainingTable from '../EducationTraining/EducationTrainingTable'
import RewardSubsetTable from '../RewardSubset/RewardSubsetTable'
import PenaltySubsetTable from '../PenaltySubset/PenaltySubsetTable'
import FamilySocietyTable from '../FamilySociety/FamilySocietyTable'
import LiquiditySubsetTable from '../LiquiditySubset/LiquiditySubsetTable'
import LaborContractTable from '../LaborContract/LaborContractTable'
import AdjustCommunicationTable from '../AdjustCommunication/AdjustCommunicationTable'
import RetirementSubsetTable from '../RetirementSubset/RetirementSubsetTable'
import OrganizationInvestigationTable from '../OrganizationInvestigation/OrganizationInvestigationTable'
import ConcurrentPositionTable from '../ConcurrentPosition/ConcurrentPositionTable'
import GoingAbroadTable from '../GoingAbroad/GoingAbroadTable'
import CurriculumVitaeTable from '../CurriculumVitae/CurriculumVitaeTable'
import Department from '@/components/Department'
import PersonnelInformationTable from '../PersonnelInformation/PersonnelInformationTable'

export default {
  name: 'personnel-base-information',
  components: {
    PersonnelInformationTable,
    PersonnelBaseStaffSubsetTable,
    Department,
    PersonnelBaseTable,
    PersonnelDegreeTable,
    AdministrativePositionTable,
    PoliticalOutlookTable,
    TechnicalPositionTable,
    TechnicalLevelTable,
    WageSubsetTable,
    WageChangeTable,
    PositionInformationTable,
    SpecialTalentsTable,
    ProfessionalQualificationTable,
    EducationTrainingTable,
    RewardSubsetTable,
    PenaltySubsetTable,
    FamilySocietyTable,
    LiquiditySubsetTable,
    LaborContractTable,
    AdjustCommunicationTable,
    RetirementSubsetTable,
    OrganizationInvestigationTable,
    ConcurrentPositionTable,
    GoingAbroadTable,
    CurriculumVitaeTable
  },
  data () {
    return {
      activeName: 'base',
      activeSunName: 'baseStaffSubset',
    }
  },
  mounted() {

    this.$refs.base.batchAdd(this.$refs.baseStaffSubset.batchAdd)
    this.$store.commit("changeTableName", 'BASE_STAFF_SUBSET');

  },
  methods: {
    handleClick (tab, event) {

      switch (tab.name) {
        case 'baseStaffSubset':
          this.$refs.baseStaffSubset.clickSubset()
          this.$refs.base.batchAdd(this.$refs.baseStaffSubset.batchAdd)
          this.$store.commit("changeTableName", 'BASE_STAFF_SUBSET');
          break
        case 'degree':
          this.$refs.degree.clickSubset()
          this.$refs.base.batchAdd(this.$refs.degree.batchAdd)
          this.$store.commit("changeTableName", 'STAFF_DEGREE');
          break
        case 'administrative':
          this.$refs.administrative.clickSubset()
          this.$refs.base.batchAdd(this.$refs.administrative.batchAdd)
          break
        case 'political':
          this.$refs.political.clickSubset()
          this.$refs.base.batchAdd(this.$refs.political.batchAdd)
          break
        case 'technical':
          this.$refs.technical.clickSubset()
          this.$refs.base.batchAdd(this.$refs.technical.batchAdd)
          break
        case 'workerLevel':
          this.$refs.workerLevel.clickSubset()
          this.$refs.base.batchAdd(this.$refs.workerLevel.batchAdd)
          break
        case 'wage':
          this.$refs.wage.clickSubset()
          this.$refs.base.batchAdd(this.$refs.wage.batchAdd)
          break
        case 'WageChange':
          this.$refs.WageChange.clickSubset()
          this.$refs.base.batchAdd(this.$refs.WageChange.batchAdd)
          break
        case 'position':
          this.$refs.position.clickSubset()
          this.$refs.base.batchAdd(this.$refs.position.batchAdd)
          break
        case 'SpecialTalents':
          this.$refs.SpecialTalents.clickSubset()
          this.$refs.base.batchAdd(this.$refs.SpecialTalents.batchAdd)
          break
        case 'resume':
          this.$refs.resume.clickSubset()
          this.$refs.base.batchAdd(this.$refs.resume.batchAdd)
          break
        case 'occupation':
          this.$refs.occupation.clickSubset()
          this.$refs.base.batchAdd(this.$refs.occupation.batchAdd)
          break
        case 'education':
          this.$refs.education.clickSubset()
          this.$refs.base.batchAdd(this.$refs.education.batchAdd)
          break
        case 'reward':
          this.$refs.reward.clickSubset()
          this.$refs.base.batchAdd(this.$refs.reward.batchAdd)
          break
        case 'penalty':
          this.$refs.penalty.clickSubset()
          this.$refs.base.batchAdd(this.$refs.penalty.batchAdd)
          break
        case 'FamilySociety':
          this.$refs.FamilySociety.clickSubset()
          this.$refs.base.batchAdd(this.$refs.FamilySociety.batchAdd)
          break
        case 'Liquidity':
          this.$refs.Liquidity.clickSubset()
          this.$refs.base.batchAdd(this.$refs.Liquidity.batchAdd)
          break
        case 'labor':
          this.$refs.labor.clickSubset()
          this.$refs.base.batchAdd(this.$refs.labor.batchAdd)
          break
        case 'cadre':
          this.$refs.cadre.clickSubset()
          this.$refs.base.batchAdd(this.$refs.cadre.batchAdd)
          break
        case 'retirement':
          this.$refs.retirement.clickSubset()
          this.$refs.base.batchAdd(this.$refs.retirement.batchAdd)
          break
        case 'investigation':
          this.$refs.investigation.clickSubset()
          this.$refs.base.batchAdd(this.$refs.investigation.batchAdd)
          break
        case 'concurrent':
          this.$refs.concurrent.clickSubset()
          this.$refs.base.batchAdd(this.$refs.concurrent.batchAdd)
          break
        case 'GoingAbroad':
          this.$refs.GoingAbroad.clickSubset()
          this.$refs.base.batchAdd(this.$refs.GoingAbroad.batchAdd)
          break
        default:
          console.log('首页')
      }
    }
  }
}
</script>

<style lang="less">
.base-info {
  display: flex;
  width: calc(100vw - 240px);
  height: 100%;

  .department {
    margin: 0 20px 0 0;
    width: 240px;
  }
}
// .pane-item {
//   height: calc(100vh - 546px);
// }
.pane-item-1 {
  height: 100%;
}
.tab-main {
  width: 100%;
}
</style>
